/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.inspur.edp.web.command.component.metadata;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

/**
 * 功能描述: @ClassName: CmpMethodRefering @Author: Fynn Qi @Date: 2020/1/1 9:09 @Version: V1.0
 */
public class CmpMethodRefering implements CommandItem {
//    private String id;
//    private String code;
//    private String name;
//    private String componentId;
//    private String componentCode;
//    private String componentName;
//    private String componentPath;
//    private String methodId;
//    private String methodCode;
//    private String methodName;
//    private boolean replaced;
//    private boolean beforeExpansion;
//    private boolean afterExpansion;
//    private final List<CmpMethodParamConfig> paramConfigs;

    @JsonProperty("Id")
    private String id;

    @JsonProperty("Code")
    private String code;

    @JsonProperty("Name")
    private String name;

    @JsonProperty("ComponentId")
    private String componentId;

    @JsonProperty("ComponentCode")
    private String componentCode;

    @JsonProperty("ComponentName")
    private String componentName;

    @JsonProperty("ComponentPath")
    private String componentPath;

    @JsonProperty("MethodId")
    private String methodId;

    @JsonProperty("MethodCode")
    private String methodCode;

    @JsonProperty("MethodName")
    private String methodName;

    @JsonProperty("IsReplaced")
    private boolean replaced;

    @JsonProperty("IsBeforeExpansion")
    private boolean beforeExpansion;

    @JsonProperty("IsAfterExpansion")
    private boolean afterExpansion;

    @JsonProperty("ParamConfigs")
    private List<CmpMethodParamConfig> paramConfigs;

    public CmpMethodRefering() {
        this.paramConfigs = new ArrayList<>();
    }

    @Override
    public CommandItemType getItemType() {
        return CommandItemType.MethodRefer;
    }

    @Override
    public String getItemName() {
        return this.methodName;
    }

    @Override
    public String getItemId() {
        return MessageFormat.format("{0}{1}", this.methodId, this.methodCode);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComponentId() {
        return componentId;
    }

    public void setComponentId(String componentId) {
        this.componentId = componentId;
    }

    public String getComponentCode() {
        return componentCode;
    }

    public void setComponentCode(String componentCode) {
        this.componentCode = componentCode;
    }

    public String getComponentName() {
        return componentName;
    }

    public void setComponentName(String componentName) {
        this.componentName = componentName;
    }

    public String getComponentPath() {
        return componentPath;
    }

    public void setComponentPath(String componentPath) {
        this.componentPath = componentPath;
    }

    public String getMethodId() {
        return methodId;
    }

    public void setMethodId(String methodId) {
        this.methodId = methodId;
    }

    public String getMethodCode() {
        return methodCode;
    }

    public void setMethodCode(String methodCode) {
        this.methodCode = methodCode;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public boolean isReplaced() {
        return replaced;
    }

    public void setReplaced(boolean replaced) {
        this.replaced = replaced;
    }

    public boolean isBeforeExpansion() {
        return beforeExpansion;
    }

    public void setBeforeExpansion(boolean beforeExpansion) {
        this.beforeExpansion = beforeExpansion;
    }

    public boolean isAfterExpansion() {
        return afterExpansion;
    }

    public void setAfterExpansion(boolean afterExpansion) {
        this.afterExpansion = afterExpansion;
    }

    public List<CmpMethodParamConfig> getParamConfigs() {
        return paramConfigs;
    }
}
